import logging
import sys
import pandas as pd



from llama_index.core.evaluation import DatasetGenerator, RelevancyEvaluator
from llama_index.core import SimpleDirectoryReader, VectorStoreIndex, Response
from llama_index.llms.openai import OpenAI


logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))

from llms import gangtise_llm

from llama_index.core import Settings
Settings.llm = gangtise_llm()



reader = SimpleDirectoryReader(r"C:\my\part1_rag\tmp\data\paul_graham")
documents = reader.load_data()

data_generator = DatasetGenerator.from_documents(documents)

eval_questions = data_generator.generate_questions_from_nodes()
print(eval_questions)